<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>登录</title>
    <link rel="stylesheet" href="login.css">
</head>

<body>


    <div class="login">
        <div class="img"> <img src="../user.png" alt="X"></div>
        <h2>登录</h2>
        <form action="">

            <div class="txtb">
                <!-- placeholder="请输入登录账号" -->
                <input type="text" class="input-box" name="username">
                <span data-placeholder="账号"></span>
            </div>
            <div class="txtb">
                <!-- placeholder="请输入登录密码" -->
                <input type="password" class="input-box" name="password">
                <span data-placeholder="密码"></span>
            </div>

            <label>
                <input type="checkbox" class="check"> <span>记住我</span>
            </label>
            <button class="input-btn">
                登录
            </button>
        </form>
        <div class="register">
            还没有账号？<a href="">请注册</a>
        </div>
    </div>

    <script src="./js/vendor/jquery-3.3.1.min.js"></script>

    <script>
        $(document).ready(function () {

            $('.txtb input').on('focus', function (evt) {
                $(this).addClass('focus');
            })
            $('.txtb input').on('blur', function (evt) {
                if ($(this).val() == '') {
                    $(this).removeClass('focus');
                }
            })
        })
    </script>
</body>

</html>